import { ref } from 'vue';
import * as $axios from '../api/index'
import { useDemoStore } from '../pinia/index'
const store = useDemoStore()

const useModel = (num) => {
    const newModel = ref([])
    const data = {
        token: store.token,
        keywords: num
    }
    $axios.$product_find(data).then(res => {
        newModel.value = res.data.map(item => {
            return {
                'label': item.model,
                'id': item.product_id
            }
        })
    })
    return {
        newModel
    }
}
export default useModel